﻿using BUGCOME.Model.Auth;
using BUGCOME.Model.Auth.dto;
using BUGCOME.ServiceCore;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BUGCOME.ServiceCore.Services.IServices
{
    /// <summary>
    /// 角色管理服务接口，继承基础CRUD服务接口
    /// </summary>
    public interface IRoleService : IBaseService<Role>
    {
        /// <summary>
        /// 新增角色菜单信息
        /// </summary>
        /// <param name="roleDto"></param>
        /// <returns></returns>
        Task<long> InsertRoleMenuAsync(RoleDto roleDto);

        /// <summary>
        /// 判断用户是否为管理员
        /// </summary>
        /// <param name="uid">用户ID</param>
        /// <returns>是否为管理员的异步任务</returns>
        Task<bool> IsAdminAsync(long uid);

        /// <summary>
        /// 查询用户关联的角色权限键列表
        /// </summary>
        /// <param name="id">用户ID</param>
        /// <returns>角色权限键列表的异步任务</returns>
        Task<List<string>> SelectUserRoleKeysAsync(long id);

        /// <summary>
        /// 根据用户ID查询其拥有的角色列表
        /// </summary>
        /// <param name="userId">用户ID</param>
        /// <returns>角色列表的异步任务</returns>
        Task<List<Role>> SelectUserRoleListByUserIdAsync(long userId);

        /// <summary>
        /// 查询用户的角色ID列表
        /// </summary>
        /// <param name="userId">用户ID</param>
        /// <returns>角色ID列表的异步任务</returns>
        Task<List<long>> SelectUserRolesAsync(long userId);

    }
}